<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="order by dede58.com"/>
    <title>个人信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="common/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="common/bootstrap/css/bootstrap.css" media="all">
    <link rel="stylesheet" type="text/css" href="common/global.css" media="all">
    <link rel="stylesheet" type="text/css" href="css/personal.css" media="all">
    <script src="js/jquery2.js"></script>
    <script src="common/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<section class="layui-larry-box">
    <div class="larry-personal">
        <input type="text" value="${state}" hidden id="checks"/>
        <div class="layui-tab">
            <div class="layui-tab-content larry-personal-body clearfix mylog-info-box">
                <!-- 操作日志 -->
                <div class="layui-tab-item layui-field-box layui-show">
                    <form action="dept/forwardUpdate">
                        <input type="text" hidden id="checkText" name="checkText">
                        <table class="layui-table table-hover" lay-even="" lay-skin="nob">
                            <thead>
                            <tr>
                                <th><input type="checkbox" disabled></th>
                                <th>部门编号</th>
                                <th>部门名称</th>
                                <th>上级部门</th>
                                <th>部门负责人</th>
                                <th>部门电话</th>
                                <th>传真</th>
                                <th>部门邮箱</th>
                                <th>部门职责</th>
                            </tr>
                            </thead>
                            <tbody id="tbody">

                            </tbody>
                        </table>
                        <div class="larry-table-page clearfix">
                            <button class="layui-btn layui-btn-small" id="btnUpdate"><i
                                    class="iconfont icon-shanchu1"></i>修改部门
                            </button>
                            <button class="layui-btn layui-btn-small" id="btnId"><i class="iconfont icon-shanchu1"></i>修改编号
                            </button>
                            <div id="page" class="page"></div>
                        </div>
                    </form>
                </div>
                <script>
                    $(function () {
                        $.ajax({
                            type: "get",
                            url: "dept/queryAll",
                            dataType: "json",
                            success: function (data) {
                                $.each(data, function (index, da) {
                                    var rows = "<tr>" +
                                        "<th><input type='checkbox' value='" + da.id + "' name='id' /></th>" +
                                        "<th>" + da.dbian + "</th>" +
                                        "<th>" + da.dname + "</th>" +
                                        "<th>" + da.wname + "</th>" +
                                        "<th>" + da.dmanager + "</th>" +
                                        "<th>" + da.dtel + "</th>" +
                                        "<th>" + da.dfax + "</th>" +
                                        "<th>" + da.demail + "</th>" +
                                        "<th>" + da.duty + "</th>" +
                                        "</tr>";
                                    $("#tbody").append(rows);
                                })
                            },
                            error: function () {
                                window.location.href = "404.jsp";
                            }
                        });
                        $("#btnUpdate").click(function (e) {
                            $("#checkText").val("success");
                        });
                        $("#btnId").click(function () {
                            $("#checkText").val("error");
                        });
                    });
                </script>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript" src="common/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['jquery', 'layer', 'element', 'laypage'], function () {
        window.jQuery = window.$ = layui.jquery;
        window.layer = layui.layer;
        var element = layui.element(),
            laypage = layui.laypage;


        laypage({
            cont: 'page',
            pages: 10 //总页数
            ,
            groups: 5 //连续显示分页数
            ,
            jump: function (obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                var curr = obj.curr;
                if (!first) {
                    //layer.msg('第 '+ obj.curr +' 页');
                }
            }
        });

        laypage({
            cont: 'page2',
            pages: 10 //总页数
            ,
            groups: 5 //连续显示分页数
            ,
            jump: function (obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                var curr = obj.curr;
                if (!first) {
                    //layer.msg('第 '+ obj.curr +' 页');
                }
            }
        });
    });
</script>
</body>
</html>